package com.qdxwx.data.service.order;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.order.OrderDetail;
import com.qdxwx.models.order.OrderDetailQuery;

import java.util.List;

/**
 * OrderDetail接口
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
public interface OrderDetailService {

    /**
     * 添加OrderDetail
     */
    int insert(OrderDetail orderDetail);

    /**
     * 批量添加OrderDetail
     */
    void addBatchOrderDetail(List<OrderDetail> orderDetailList);

    /**
     * 根据id删除一个OrderDetail
     */
    void delete(Long id);

    /**
     * 修改OrderDetail
     */
    int update(OrderDetail orderDetail);

    /**
     * 根据id获取单个OrderDetail对象
     */
    OrderDetail get(Long id);
    /**
     * 根据条件获取OrderDetail列表
     */
    List<OrderDetail> getList(OrderDetailQuery query);

    List<OrderDetail> getListByOrderId(Integer orderId);

    List<OrderDetail> getList(OrderDetailQuery query, PageRequest page);

    long count(OrderDetailQuery query);

    int updateOrderDetailStatusSuccess(OrderDetail orderDetail);

    List<OrderDetail> getTimeOverOrder();

    OrderDetail getByOrderId(int orderId);

    long sumPrice(OrderDetailQuery orderDetail);

    long countByCourse(OrderDetailQuery orderDetail);

    List<OrderDetail> getListByCourse(OrderDetailQuery query, PageRequest page);

    int updateCombine(long userId1, long userId2);
}